<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <script src="js/jquery-3.3.1.js"></script>
</head>
<body>
<script>
    var phone="17861110910";
    var password="212888aa";
    function one() {
        $.ajax({
            url:'duanxin',
            type:'post',
            data:{phone:phone},
            success: function(data){
                alert(data);
            }
        })
    }
    function two() {
        $.ajax({
            url:'phone',
            type:'post',
            data:{phone:phone},
            success: function(data){
                alert(data);
            }
        })
    }
    function three() {
        $.ajax({
            url:'zhuche',
            type:'post',
            data:{phone:phone,password:password},
            success: function(data){
                alert(data);
            }
        })
    }
    function four() {
        $.ajax({
            url:'denglu',
            type:'post',
            data:{phone:phone,password:password},
            success: function(data){
                if(data.denglu==1){
                    $("#four").html("<h1>"+data.user.nicheng+"</h1><img src='"+data.user.touxiang+"' height='120' width='120'/>")
                }else{
                    alert("账号或密码错误！")
                }
            }
        })
    }
    function five() {
        $.ajax({
            url:'gainicheng',
            type:'post',
            data:{nicheng:nicheng},
            success: function(data){

            }
        })
    }
    function six() {
        $.ajax({
            url:'gaiphone',
            type:'post',
            data:{phone:phone},
            success: function(data){
                alert(data);
            }
        })
    }
</script>
<input type="button" onclick="one()" value="手机">
<input type="button" onclick="two()" value="手机号">
<input type="button" onclick="three()" value="注册">
<input type="button" onclick="four()" value="登录">
<input type="button" onclick="five()" value="改昵称">
<input type="button" onclick="six()" value="改绑定手机">
<div id="four"></div>
</body>
</html>